-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds "is_managed" key in Parse.ly Integration if integration is managed by VIP #4802
Adds "is_managed" key in Parse.ly Integration if integration is managed by VIP #4802
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #4802 +/- ##
==========================================
Coverage 28.98% 28.98%
Complexity 4692 4692
==========================================
Files 276 276
Lines 20711 20711
==========================================
Hits 6004 6004
Misses 14707 14707
|
2bd16ca
to
701ec7e
Compare
return array( | ||
// If config provided by VIP is empty then take original credentials else take | ||
// credentials from config. | ||
$credentials = empty( $config ) ? $original_credentials : array( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small suggestion - may be better to check for the keys you need explicitly (site_id
and api_secret
) rather than any $config
value. If $config
currently or in the future accepts other configuration keys, this code would set both values to null
if any other configuration key is set.
$credentials = empty( $config ) ? $original_credentials : array( | |
$credentials = ( isset( $config[ 'site_id' ] ) && isset( $config[ 'api_secret' ] ) ? array( ... ) : $original_credentials; |
(note this implementation switches the order of the array values and $original_credentials
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$original_credentials
means credentials that we got from plugin so I think its fine to return as it is without any extra checks to keep things simple. Later we can improve if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small suggestion on $config
value testing, otherwise good to go!
Description
By default we shows a banner on the plugin which let customers know to add credentials but for integration enabled via VIP we don't want to show this banner because if the site is yet to launch then we don't have its domain and without domain we cannot setup Parse.ly credentials so enabling the integration properly is a two step process:
Enable the integration when environment is init so that customers are already aware of Parse.ly and don't have surprises or unexpected behavior during launch.
Configure the integration ( i.e. setup credentials ) after the launch.
Changes Made
Changelog Description
Adds "is_managed" key in Parse.ly Integration if managed by VIP
Pre-review checklist
Please make sure the items below have been covered before requesting a review:
Pre-deploy checklist
Steps to Test
wp_parsely_credentials
filter (git clone [email protected]:Parsely/wp-parsely.git wp-parsely-3.8
)